﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>用户信息修改</title>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
	<script>
		function showa(){
			alert("修改完成！");
		}
	</script>
</head>
<body>
<c:if test="${not empty user}">
	<div class="main">
		<div class="optitle clearfix">
			<div class="title">用户管理 &gt;&gt; 修改用户</div>
		</div>

		<form id="form1" name="form1" method="post" action="${pageContext.request.contextPath}/user/update">
			<input type="hidden" name="method" value="update">
			<div class="content">
				<table class="box">
					<tbody>
					<tr>
						<td class="field">用户编号：</td>
						<input type="hidden" name="id" value="${user.id}">
						<td>${user.id}</td>
					</tr>
					<tr>
						<td class="field">用户名：</td>
						<td>
							<input type="text" name="username" class="text" id="username" value="${user.username}">
							<span style="color:red">*</span>
							<span style="color:red" id="username_span"></span>
						</td>
					</tr>
					<tr>
						<td class="field">姓名：</td>
						<td>
							<input type="text" name="name" class="text" id="name" value="${user.name}">
							<span style="color:red">*</span>
							<span style="color:red" id="name_span"></span>
						</td>
					</tr>
					<tr>
						<td class="field">用户职位：</td>
						<td>
							<input type="radio" name="role" value="管理员" <c:if test="${user.role eq '管理员'}">checked="checked"</c:if>>管理员
							<input type="radio" name="role" value="收银员" <c:if test="${user.role eq '收银员'}">checked="checked"</c:if>>收银员
							<input type="radio" name="role" value="经理" <c:if test="${user.role eq '经理'}">checked="checked"</c:if>>经理
							<input type="radio" name="role" value="店员" <c:if test="${user.role eq '店员' or empty user.role}">checked="checked"</c:if>>店员
						</td>
					</tr>
					</tbody>
				</table>
			</div>
			<div class="buttons">
				<input type="submit" name="update" id="update" value="修改" class="input-button" onclick="showa()">
				<input type="button" name="button" id="button" onclick="history.back(-1)" value="返回" class="input-button">
			</div>
		</form>
	</div>
</c:if>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/user/update.js"></script>
</body>
</html>